<!DOCTYPE HTML>
<html>

<head>
	<title>修改密码</title>
	<meta charset="utf-8">
  <meta name="viewport" content="width=device-width,initial-scale=1.0">
	<link rel="stylesheet" type="text/css" href="./hui/css/H-ui.min.css" />
	<link rel="stylesheet" type="text/css" href="./hui/css/H-ui.admin.css" />
	<link rel="stylesheet" type="text/css" href="./hui/Hui-iconfont/1.0.8/iconfont.css" />
</head>

<body>
	<div id="app">
		<article class="page-container">
			<div class="form form-horizontal" id="form-admin-add">
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-3">用户名：</label>
					<div class="formControls col-xs-8 col-sm-9">
						{{ adminname }}
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-3">初始密码：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="password" class="input-text" id="password" v-model="password"
							placeholder="请输入初始密码">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-3">新密码：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="password" class="input-text" id="newpassword" v-model="newpassword"
							placeholder="请输入新密码">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-3">确认密码：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="password" class="input-text" id="repassword" v-model="repassword"
							placeholder="请输入确认密码">
					</div>
				</div>
				<div class="row cl">
					<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
						<button class="btn btn-secondary radius" @click.prevent="editpwd()"><i
								class="Hui-iconfont">&#xe632;</i>提交保存</button>
						<button class="btn btn-default radius" @click.prevent="reset()">
							<i class="Hui-iconfont">&#xe68f;</i>取消重置
						</button>
					</div>
				</div>
			</div>
		</article>
	</div>

	<script type="text/javascript" src="./hui/jquery/1.9.1/jquery.min.js"></script>
	<script type="text/javascript" src="./hui/js/H-ui.min.js"></script>
	<script type="text/javascript" src="./hui/js/H-ui.admin.js"></script>

  <!--下方是此页面业务相关的脚本-->
	<script type="text/javascript" src="./hui/layui/layui.js"></script>
	<script type="text/javascript" src="./hui/js/axios.min.js"></script>
	<script type="text/javascript" src="./hui/js/vue.js"></script>
	<script type="text/javascript">
		const vue = new Vue({ // 实例化Vue对象
			el: '#app',// 绑定作用域
			data: { //定义数据 用于vue的双向绑定
				adminid: '',
				adminname: '',
				password: '',
				newpassword: '',
				repassword: '',
			},
			methods: {
				editpwd: function () { // 修改按钮点击事件
					let _this = this;
					var data = {
						adminid: _this.adminid,
						password: _this.password,
						repassword: _this.repassword,
					};
					axios.post('http://127.0.0.1:8080/vue_wuye/admin/editpwd.action', data).then(result => {
						alert(result.data.message);
						var index = parent.layer.getFrameIndex(window.name);
						parent.location.reload();
						parent.layer.close(index);
					});
				},
				reset: function () { // 重置按钮点击事件
					password = '';
					newpassword = '';
					repassword = '';
				},
				validate: function () { // 验证输入非空

				},
				loadPage: function () { // 页面加载
					this.adminid = sessionStorage.getItem('adminid');
					this.adminname = sessionStorage.getItem('adminname');
				},
			},
			created() { // 生命周期相关的函数
				this.loadPage();
			},
		})
	</script>
	<!--/ 上方是此页面业务相关的脚本-->
</body>

</html>






